var getContent=location.search
var getCookie=readCookie("user")
if(!getCookie){
	location.href="login.htm"
}
var getUname=getUserName()
var star=""
var myContent=""
function setComment(){
	star=$("#dir").html()
	myContent=$("#textarea1").val()
	star=star.substring(0,star.indexOf("分"))
	if(myContent==""){
		$.DialogByZ.Alert({Title: "提示", Content: "评论内容不能为空",BtnL:"确定"})
		
	}else{
		subComment()
	}
	
}
function subComment() {
	
	$.ajax({
		url: "http://localhost:8080/comment/add"+getContent,
		type: "get",
		data: {
			"uId": getCookie,
			"uName":getUname,
			"cStar":star,
			"comment":myContent
		},
		async: false,
		dataType: "json",
		success: function(data) {
			if(data.status==1){
				$.DialogByZ.Autofade({Content: data.msg})
			}else{
				$.DialogByZ.Alert({Title: "提示", Content:data.msg,BtnL:"确定"})
				
			}

		}
	})
	
}
